package com.example.jpa.crud.model;

import java.util.HashMap;
import java.util.Map;

public class DefaultJsonViewTemplate implements JsonViewTemplate {

    @Override
    public Object ok(Object data, boolean update, long effect) {
        return data;
    }

    @Override
    public Object err(Exception e) {
        final Map<String, Object> map = new HashMap<>();
        map.put("exception",e.getClass().getSimpleName());
        map.put("message", e.getMessage());
        return map;
    }

}